package cn.wolfcode.wolf2w.service.impl;

import cn.wolfcode.wolf2w.domain.Personal;
import cn.wolfcode.wolf2w.domain.Strategy;
import cn.wolfcode.wolf2w.repository.PersonalRepository;
import cn.wolfcode.wolf2w.service.IPersonalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonalServiceImpl implements IPersonalService{
    @Autowired
    private PersonalRepository repository;

    @Override
    public void save(Personal personal) {
        personal.setId(null);
        repository.save(personal);
    }

    @Override
    public Personal get(String id) {
        Personal personal = repository.findById(id).orElse(null);
        return personal;
    }

    @Override
    public List<Personal> list() {
        List<Personal> list = repository.findAll();
        return list;
    }

    @Override
    public List<Strategy> queryForStrategy(String id) {


        return null;
    }
}
